package week2;

import java.util.Arrays;

import java.util.Arrays;

public class report4 {
    public static void main(String[] args) {
        int[] numbers = {25, 63, 54, 91, 14, 5, 17, 25, 88, 32, 44};
        System.out.println("排序前的数组: " + Arrays.toString(numbers));
        Arrays.sort(numbers);
        System.out.println("排序后的数组: " + Arrays.toString(numbers));
        int target1 = 14;
        int target2 = 88;
        int index1 = Arrays.binarySearch(numbers, target1);
        int index2 = Arrays.binarySearch(numbers, target2);
        System.out.println("元素 " + target1 + " 在排序后的数组中的索引是: " + index1);
        System.out.println("元素 " + target2 + " 在排序后的数组中的索引是: " + index2);
    }
}
